#{extends '/template/main.html' /}
<!-- Removing search and results count filter -->
<div class="panel panel-default">
    <div class="panel-heading">
        <h3 class="panel-title">投诉订单</h3>
    </div>
    <div class="panel-body">
        <form method="get" id="searchForm" action="/BS00029/admin/complaint/trial/index/${pageNumber}">
            <div style="margin-bottom: 20px;width:160px;float: left;">
                <input type="text" name="orderNumber" id="orderNumber" class="form-control" style="width:150px" placeholder="订单编号" value="${orderNumber}">
            </div>
            <div style="margin-bottom: 20px;width:160px;float: left;">
                <input type="text" name="userName" id="userName" class="form-control" style="width:150px" placeholder="下单人" value="${userName}">
            </div>
            <div style="margin-bottom: 20px;width:160px;float: left;">
                <input type="text" name="merchantName" id="merchantName" class="form-control" style="width:150px" placeholder="商户名称" value="${merchantName}">
            </div>
        *{  <div style="margin-bottom: 20px;width:160px;float: left;">
                <input type="text" name="orderNumber" id="orderNumber" class="form-control" style="width:150px" placeholder="订单编号" value="${orderNumber}">
            </div>
           <div style="margin-bottom: 20px;width:120px;float: left;margin-right: 10px;">
                <input type="text" class="form-control datepicker" data-format="yyyy-mm-dd" name="startTime" style="width: 120px" placeholder="开始时间" value="${startTime}">
            </div>
            <div style="margin-bottom: 20px;width:120px;float: left;margin-right: 10px;">
                <input type="text" class="form-control datepicker" data-format="yyyy-mm-dd" name="endTime" style="width: 120px" placeholder="结束时间" value="${endTime}">
            </div>}*
        </form>
        <button class="btn btn-turquoise" id="searchBtn">开始检索</button>

        <table class="table table-bordered table-striped" id="example-2">
            <thead>
            <tr>
                <th class="no-sorting">
                    <input type="checkbox" class="cbr">
                </th>
                <th>订单编号</th>
                <th>商家</th>
                <th>下单人</th>
                <th>下单时间</th>
                <th>总金额(元)</th>
                <th>投诉时间</th>
                <th>是否处理</th>
                <th>操作</th>
            </tr>
            </thead>

            <tbody class="middle-align">
            #{paginate.list items:reportList , as :'report'}
            <tr>
                <td>
                    <input type="checkbox" class="cbr">
                </td>
                <td>${report?.order?.orderNumber}</td>
                <td>${report?.merchant?.name}</td>
                <td>${report?.order?.webUser?.nickName}</td>
                <td>${report?.order?.createdAt?.format('MM-dd HH:mm')}</td>
                <td>${report?.amount?.format('#.##')}</td>
                <td>${report?.createAt?.format('MM-dd HH:mm')}</td>
                #{if report?.trial == null}
                    <td>未处理</td>
                #{/if}
                #{if report?.trial != null}
                    <td>已处理</td>
                #{/if}
                <td>
                    <a href="/BS00029/admin/complaint/trial/detil/${report?.id}/${pageNumber}" class="btn btn-secondary btn-sm btn-icon icon-left">
                        查看
                    </a>

                </td>
            </tr>
            #{/paginate.list}
            </tbody>
        </table>
        <div id="layerPage" class="col-xs-12"></div>
    </div>
</div>



<!-- Imported styles on this page -->
<link rel="stylesheet" href="/public/js/datatables/dataTables.bootstrap.css">

<script src="/public/js/datatables/js/jquery.dataTables.min.js"></script>


<!-- Imported scripts on this page -->
<script src="/public/js/datatables/dataTables.bootstrap.js"></script>
<script src="/public/js/datatables/yadcf/jquery.dataTables.yadcf.js"></script>
<script src="/public/js/datatables/tabletools/dataTables.tableTools.min.js"></script>

<script type="text/javascript" src="/public/laypage/laypage.js"></script>
<script type="text/javascript">
    var orderType = '${orderType}';
    var frozenGoodsType = '${frozenGoodsType}';
    $(document).ready(function(){
        // 提示
        var msg = '${flash.get("msg")}';
        if(msg) {
            saveSuccess(msg);
        }

        // 分页
        laypage({
            cont: $('#layerPage'), //容器。值支持id名、原生dom对象，jquery对象,
            pages: '${resultPage?.pageCount}', //总页数
            skin: 'yahei',
            skip: true, //是否开启跳页
            curr:'${pageNumber}',
            jump: function(e, first){ //触发分页后的回调
                if(!first){ //一定要加此判断，否则初始时会无限刷新
                    $('#pageNumber').val(e.curr);
                    $("#searchForm").attr("action", "/BS00029/admin/complaint/trial/index/"+e.curr);
                    $('#searchForm').submit();
                }
            }
        });
        $(document).on("click", "#searchBtn", function(){
            $("#searchForm").attr("action", "/BS00029/admin/complaint/trial/index/1");
            $('#searchForm').submit();
        })
    });




</script>


